package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AlpContractStageDetailMapper;
import com.ruoyi.system.domain.AlpContractStageDetail;
import com.ruoyi.system.service.IAlpContractStageDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 阶段明细Service业务层处理
 * 
 * @author zhangjun
 * @date 2020-02-13
 */
@Service
public class AlpContractStageDetailServiceImpl implements IAlpContractStageDetailService 
{
    @Autowired
    private AlpContractStageDetailMapper alpContractStageDetailMapper;

    /**
     * 查询阶段明细
     * 
     * @param id 阶段明细ID
     * @return 阶段明细
     */
    @Override
    public AlpContractStageDetail selectAlpContractStageDetailById(Long id)
    {
        return alpContractStageDetailMapper.selectAlpContractStageDetailById(id);
    }

    @Override
    public List<AlpContractStageDetail> selectAlpContractStageDetailByStageId(Long stageId) {
        return alpContractStageDetailMapper.selectAlpContractStageDetailByStageId(stageId);
    }

    /**
     * 查询阶段明细列表
     * 
     * @param alpContractStageDetail 阶段明细
     * @return 阶段明细
     */
    @Override
    public List<AlpContractStageDetail> selectAlpContractStageDetailList(AlpContractStageDetail alpContractStageDetail)
    {
        return alpContractStageDetailMapper.selectAlpContractStageDetailList(alpContractStageDetail);
    }

    /**
     * 新增阶段明细
     * 
     * @param alpContractStageDetail 阶段明细
     * @return 结果
     */
    @Override
    public int insertAlpContractStageDetail(AlpContractStageDetail alpContractStageDetail)
    {
        return alpContractStageDetailMapper.insertAlpContractStageDetail(alpContractStageDetail);
    }

    /**
     * 修改阶段明细
     * 
     * @param alpContractStageDetail 阶段明细
     * @return 结果
     */
    @Override
    public int updateAlpContractStageDetail(AlpContractStageDetail alpContractStageDetail)
    {
        alpContractStageDetail.setUpdateTime(DateUtils.getNowDate());
        return alpContractStageDetailMapper.updateAlpContractStageDetail(alpContractStageDetail);
    }

    /**
     * 删除阶段明细对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAlpContractStageDetailByIds(String ids)
    {
        return alpContractStageDetailMapper.deleteAlpContractStageDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除阶段明细信息
     * 
     * @param id 阶段明细ID
     * @return 结果
     */
    @Override
    public int deleteAlpContractStageDetailById(Long id)
    {
        return alpContractStageDetailMapper.deleteAlpContractStageDetailById(id);
    }
}
